package net.destroyer.game.tetris.gui.menu;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JMenuItem;

import net.destroyer.game.tetris.gui.control.interf.IGuiCommand;

public class AppMenuitem extends JMenuItem implements ActionListener{


	/**
	 * 
	 */
	private static final long serialVersionUID = -8043369839795181909L;
	private IGuiCommand cmd;
	
	public AppMenuitem(String name) {
		super(name);
		this.addActionListener(this);
	}
	@Override
	public void actionPerformed(ActionEvent e) {
		if(cmd != null) {
			cmd.execute();
		}
	}
	public void setGuiCommand(IGuiCommand cmd){
		this.cmd = cmd;
	}
}
